<?php

namespace App\Http\Requests\Api;

use App\Http\Requests\Base;

class MessageServer extends Base
{

    public array $scenes = [
        'v1.create' => 'message_class_id,title,describe,thumb,contacts,mobile',
        'v1.list' => 'page,pageSize',
        'v1.detail' => 'id',

        'v1.delete' => 'id',
    ];


    public function rules(): array
    {
        return [
            'message_class_id' => 'bail|required',
            'title' => 'bail|required',
            'describe' => 'bail|required',
            'thumb' => 'bail|required',
            'contacts' => 'bail|required',
            'mobile' => 'bail|required',

            'noPage' => 'bail|nullable|min:1|numeric',
            'pageSize' => 'bail|nullable|min:1|numeric',

        ];
    }


    public function messages(): array
    {
        return [
            'message_class_id.required' => '分类不能为空',
            'title.required' => '标题不能为空',
            'describe.required' => '描述不能为空',
            'thumb.required' => '图片不能为空',
            'contacts.required' => '联系人不能为空',
            'mobile.required' => '联系电话不能为空',



            'page.min' => '页码不能小于1',
            'page.numeric' => '页码格式非法',
            'pageSize.min' => '查询条数不能小于1',
            'pageSize.numeric' => '查询条数格式非法',


        ];
    }

}
